﻿using System.Diagnostics;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.IO.Ports;
using BaseDll;
using Communicate;
namespace OtherDevice
{
    [Description("程控电源")]
    public abstract class ProgramPowerBase : COM_Base
    {
        public ProgramPowerBase(string name):base(name)
        {

        }

        public abstract bool SetV(int ch, double val);

        public abstract bool SetI(int ch, double val);

        public abstract bool GetV(int ch, ref double val);

        public abstract bool GetI(int ch, ref double val);

        public abstract bool Power(bool b);
    }
    [Description("光源控制")]
    public abstract class LightCtrlBase : COM_Base
    {
        public LightCtrlBase(string name) : base(name)
        {

        }

        public abstract bool Set(int channel, int value);
        public abstract int Get(int channel);
    }
    [Description("AA特殊光源")]
    public abstract class SpecialLightCtrlBase : COM_Base
    {
        public SpecialLightCtrlBase(string name) : base(name)
        {

        }

        public abstract bool Set(int channel, int value);
        public abstract int Get(int channel);
        public abstract bool CloseAll();
        public abstract bool Open(int channel);
    }
    [Description("激光测高")]
    public abstract class LaserBase : COM_Base
    {
        public LaserBase(string name) : base(name)
        {

        }

        public object Lock = new object();

        public abstract bool Get(int n_取值次数,int n_间隔时间, ref double pos);
    }
    [Description("称重")]
    public abstract class Balance_Base : COM_Base
    {
        public Balance_Base(string name) : base(name)
        {

        }
        Object muxt = new Object();
        public abstract bool Get(int n_取值次数, int n_间隔时间, ref double pos);

        public abstract void SetZore();

        

    }
    [Description("压力传感器")]
    public abstract class Pressure_Base : COM_Base
    {
        public Pressure_Base(string name) : base(name)
        {

        }

        Object muxt = new Object();
        public abstract bool Get(ref int n_Value);

        public abstract void SetZore();

        public abstract bool SetCompareValue(int n_Value);
    }

    [Description("SN扫码")]
    public abstract class SNScan_Base:COM_Base
    {
       
        public SNScan_Base(string name) : base(name)
        {

        }

        public abstract bool Function_触发扫码(int n_SnLength, ref string strSN,int n_Timeout=2000);

        public abstract int Fucntion_获取SN码(int n_SnLength, ref string strSN, int n_Timeout = 2000);
    }
    [Description("基恩士扫码")]
    public abstract class SNTcpIpBase : TcpIp_Base
    {
        public SNTcpIpBase(string name) : base(name)
        {

        }
        public abstract int Fucntion_获取SN码(int n_SnLength, ref string strSN, int n_Timeout = 2000);
    }
    [Description("扭力计")]
    public abstract class Torsiometer : COM_Base
    {
        public Torsiometer(string name) : base(name)
        {

        }
        public abstract double Function_查询扭力(ref double pos);
    }
    [Description("气密仪")]
    public abstract class AT_Base : COM_Base
    {
        public AT_Base(string name) : base(name)
        {

        }

        public abstract void Function_气密测试启动();

        public abstract int Fucntion_获取气密测试(ref double d_大泄露, ref double d_小泄露, int n_TimeOut=6000);

    }
    [Description("Plasma")]
    public abstract class Plasma_Base : COM_Base
    {
        public Plasma_Base(string name) : base(name)
        {

        }

        public abstract bool OpenPlasma();
        public abstract bool ClosePlasma();
        public abstract bool Fucntion_PlasmaOK();
        public abstract bool Function_SetPlasma功率(int nValue);

        public abstract bool Fucntion_GetPlasma功率(ref int n_Value);
        public abstract bool Function_GetPlasma气压(ref double d_Value);

    }
    [Description("固化炉")]
    public abstract class Oven_Base : COM_Base
    {
        public Oven_Base(string name) : base(name)
        {

        }

        public abstract bool Function_运行指定程序(int boxNo, int Program);
        public abstract bool Function_设置温度(int boxNo, double d_SetTem);
        public abstract bool Function_定值(int boxNo);
        public abstract bool Function_程式(int boxNo);
        public abstract bool Function_开始加热(int boxNo);
        public abstract bool Function_停止加热(int boxNo);
        public abstract bool Function_获取炉子状态(int boxNo, ref bool b_IsConnect, ref double d_ActTemp, ref double d_SetTemp, ref bool b_IsOpen, ref string str_Mode);
    }
    [Description("温度传感器")]
    public abstract class Temperature_Base : COM_Base
    {
        public Temperature_Base(string name) : base(name)
        {

        }

        public abstract bool Function_查询温度(ref double d_Temperature,int n_TimeOut=3000);

    }
    [Description("螺丝机")]
    public abstract class Screw_Base : TcpIp_Base
    {
        public Screw_Base(string name) : base(name)
        {

        }

        public abstract bool Function_GetScrewTorque(out double d_Torque);
        public abstract bool Function_GetScrewAngle(out double d_Angle);
    }
    [Description("基恩士测高")]
    public abstract class Laser_TcpIpBase : TcpIp_Base
    {
        public Laser_TcpIpBase(string name) : base(name)
        {

        }

        public object Lock = new object();

        public abstract double Get(int n_取值次数, int n_间隔时间, ref double pos);
    }
    [Description("第三方视觉")]
    public abstract class Vision_Base:TcpIp_Base
    {
        public Vision_Base(string name) : base(name)
        {

        }

        public abstract int VisionControlUsing(string str_Meg, out string[] str_Result, Action actionMove = null, int nTimeout = 3000);
        public abstract bool VisionExposureChange(string str_Meg,int nTimeout = 3000);
    }
    [Description("UV控制器")]
    public abstract class UVControlBase : COM_Base
    {
        public UVControlBase(string name) : base(name)
        {

        }

        public abstract double Function_Get光功率能量值(int n_Channal);
        public abstract double Function_Get电功率(int n_Channal);
        public abstract bool Function_Set电功率(int n_Channal,int n_Value);
        public abstract bool Function_监控电功率(int n_Channal);

    }

}